package com.infolab.aims.domain.asset;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;

import org.hibernate.validator.constraints.NotBlank;

import com.infolab.aims.common.bean.AbstractModelBean;
import com.infolab.aims.domain.Location;

@Entity
@Table(name="AMTB_ASSET_EQUIPMENT")
public class AssetEquipment extends AbstractModelBean implements Serializable {
	
	@EmbeddedId
	private AssetEquipmentPK assetEquipmentPK;
	
	private String assetEquipmentStatus;
	
	private String assetTag;
	
	private Date effectiveStartDate;
	
	private Date effectiveEndDate;

	@Column(length=10)
	@NotBlank(message="{error.empty}")
	private String companyCode;
	
	@ManyToOne
	@JoinColumn(name="locationId")
	private Location location;
	
	/*taxi no*/
	private String subLocationId;
	
	private Float unitPrice;
	
	@Transient
	private String newSerialNo;
	
	@ManyToOne
	@JoinColumn(name="assetModelId",insertable=false,updatable=false)
	private AssetModel assetModel;

	@Transient
	private boolean deleted;
	
	@Version 
	private int version;

	public AssetEquipmentPK getAssetEquipmentPK() {
		return assetEquipmentPK;
	}

	public void setAssetEquipmentPK(AssetEquipmentPK assetEquipmentPK) {
		this.assetEquipmentPK = assetEquipmentPK;
	}

	public String getAssetEquipmentStatus() {
		return assetEquipmentStatus;
	}

	public void setAssetEquipmentStatus(String assetEquipmentStatus) {
		this.assetEquipmentStatus = assetEquipmentStatus;
	}

	public String getAssetTag() {
		return assetTag;
	}

	public void setAssetTag(String assetTag) {
		this.assetTag = assetTag;
	}

	public Date getEffectiveStartDate() {
		return effectiveStartDate;
	}

	public void setEffectiveStartDate(Date effectiveStartDate) {
		this.effectiveStartDate = effectiveStartDate;
	}

	public Date getEffectiveEndDate() {
		return effectiveEndDate;
	}

	public void setEffectiveEndDate(Date effectiveEndDate) {
		this.effectiveEndDate = effectiveEndDate;
	}

	public Location getLocation() {
		return location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

	public String getSubLocationId() {
		return subLocationId;
	}

	public void setSubLocationId(String subLocationId) {
		this.subLocationId = subLocationId;
	}

	public Float getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(Float unitPrice) {
		this.unitPrice = unitPrice;
	}

	public AssetModel getAssetModel() {
		return assetModel;
	}

	public void setAssetModel(AssetModel assetModel) {
		this.assetModel = assetModel;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public String getCompanyCode() {
		return companyCode;
	}

	public void setCompanyCode(String companyCode) {
		this.companyCode = companyCode;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public String getNewSerialNo() {
		return newSerialNo;
	}

	public void setNewSerialNo(String newSerialNo) {
		this.newSerialNo = newSerialNo;
	}
	
	
}
